/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { ResponseItem, responseSuccess } from '../utils';
import type { TableListItem } from '@/components/_pages/yz/manage/index.d';
import Mock from 'mockjs';

export default {
  'POST /Inn/innAdminJson': (req: Request, res: Response) => {
    const data: TableListItem[] = Mock.mock({
      'result|1-30': [
        {
          address: '上海市 上海市 长宁区新泾镇协和路264号哈哈',
          area_type: '社区',
          concat_phone: '13783636923',
          create_at: '@now()',
          dak_id: '@id()',
          dak_name: '爱特路小区',
          id: '@id()',
          isJoined: 1,
          is_disable: 0,
          'is_login|1': ['0', '1'],
          'is_withdraw|1': ['0', '1'],
          'is_pass|1': ['0', '1', '2'],
          is_qrcode: '1',
          join_inn_name: '新零售加盟商测试dxx',
          league: '',
          master_phone: '',
          phone: '13783636923',
          pid: '',
          remark: '',
          ytd_num: 0,
          yt_station_code: '1234',
          closeMsg: [
            {
              'id|1': ['1', ''],
              reason: '222',
            },
          ],
        },
      ],
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data,
    };
    return res.json(result);
  },
  'POST /Inn/innAdminEdit': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/blackInnSet': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/getBrandAuthList': (req: Request, res: Response) => {
    const data = Mock.mock({
      'list|1-30': [
        {
          'brand|1': ['fw', 'yt', 'sto', 'zt'],
          'brand_cn|1': ['丰网', '圆通', '申通', '中通'],
          'status|1': [0, 1, 2, 3],
          type: '仅入库',
        },
      ],
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: data.list,
    };
    return res.json(result);
  },
  'POST /Inn/closeBrandCollect': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/innAdminDelete': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/getRemarkList': (req: Request, res: Response) => {
    const data = Mock.mock({
      'list|1-30': [
        {
          cm_id: '@id()',
          created_at: '@now()',
          'id|1-10000': 10000,
          inn_name: '@ctitle(5)',
          remark: '@cword(5, 10)',
          user_name: '13783636923',
        },
      ],
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: data.list,
    };
    return res.json(result);
  },
  'POST /Inn/updateInnRemark': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/uploadYtStationCode': (req: Request, res: Response) => responseSuccess(req, res),

  // 云呼
  'POST /Inn/cloudCallDetail': (req: Request, res: Response) => {
    const data = Mock.mock({
      'only_sms_auth|1': [0, 1],
      'notice_percentage|0-100': 100,
    });

    const result: ResponseItem = {
      code: 0,
      msg: '成功',
      data: data,
    };
    return res.json(result);
  },
  'POST /Inn/setCloudCallProportion': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/addWhiteList': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/setAsIndividual': (req: Request, res: Response) => responseSuccess(req, res),
};
